package com.ctbri.manage.quality.scala.original
//import com.ctbri.manage.quality.scala.original.BasicOp
//import org.slf4j.Logger
//import org.slf4j.LoggerFactory
//import lombok.Getter
//import lombok.Setter
/**
 * @author songyunlong
 * @createTime 2023/6/4 22:57
 * @description
 */
class CheckBasic (
                 appNamec: String=null,
                 masterSetc: String=null,
                 logLevelc: String=null,
                 //from csv
                 dataExportPathc: String=null,
                 dataSavePathc: String=null,
                 dataSaveStylec: String=null,
                 //from jdbc
                 urlc: String=null,
                 driverc: String=null,
                 userc: String=null,
                 passwordc: String=null,
                 dbtablec: String=null,
                 //from hive
                 databaseNamec: String=null,
                 tableNamec: String=null
                 ) extends BasicOp {

    var appName: String = appNamec
    var masterSet: String = masterSetc
    var logLevel: String = logLevelc
    var dataExportPath: String = dataExportPathc
    var dataSavePath: String = dataSavePathc
    var dataSaveStyle: String = dataSaveStylec
    var url: String = urlc
    var driver: String = driverc
    var user: String = userc
    var password: String = passwordc
    var dbtable: String = dbtablec
    var databaseName: String = databaseNamec
    var tableName: String = tableNamec


    /**
     * excel,csv,json,txt
     * @param appName
     * @param masterSet
     * @param logLevel
     * @param dataExportPath
     * @param dataSavePath
     * @param dataSaveStyle
     */
    def this(appName: String,
        masterSet: String,
        logLevel: String,
        dataExportPath: String,
        dataSavePath: String,
        dataSaveStyle: String){
        this(appNamec=appName,
            masterSetc=masterSet,
            logLevelc=logLevel,
            dataExportPathc=dataExportPath,
            dataSavePathc=dataSavePath,
            dataSaveStylec=dataSaveStyle)
    }

    /**
     * hive
     * @param appName
     * @param masterSet
     * @param logLevel
     * @param databaseName
     * @param tableName
     * @param dataSavePath
     * @param dataSaveStyle
     */
    def this(appName: String,
             masterSet: String,
             logLevel: String,
             databaseName: String,
             tableName: String,
             dataSavePath: String,
             dataSaveStyle: String){
        this(appNamec=appName,
            masterSetc=masterSet,
            logLevelc=logLevel,
            databaseNamec=databaseName,
            tableNamec=tableName,
            dataSavePathc=dataSavePath,
            dataSaveStylec=dataSaveStyle)
    }

    /**
     * jdbc
     * @param appName
     * @param masterSet
     * @param logLevel
     * @param url
     * @param driver
     * @param user
     * @param password
     * @param dbtable
     * @param dataSavePath
     * @param dataSaveStyle
     */
    def this(
            appName: String,
            masterSet: String,
            logLevel: String,
            url: String,
            driver: String,
            user: String,
            password: String,
            dbtable: String,
            dataSavePath: String,
            dataSaveStyle: String){
        this(
            appNamec=appName,
            masterSetc=masterSet,
            logLevelc=logLevel,
            urlc=url,
            driverc=driver,
            userc=user,
            passwordc=password,
            dbtablec=dbtable,
            dataSavePathc=dataSavePath,
            dataSaveStylec=dataSaveStyle
        )
    }
}

object CheckBasic extends App{
    // test
    def apply(): CheckBasic = new CheckBasic
    val checkBasic = CheckBasic()
    println(checkBasic.url)

}